//package com.baizan.daka.ui.fragment
//
//import android.view.View
//import com.baizan.daka.base.BasePageListFragment
//import com.baizan.daka.glide.ImageLoadHelp
//import com.baizan.daka.mvp.model.bean.BannerBean
//import com.baizan.daka.ui.contract.PackageContract
//import com.baizan.daka.mvp.model.bean.PackageBean
//import com.baizan.daka.ui.presenter.PackagePresenter
//import com.baizan.daka.net.BasePageResponse
//import com.baizan.daka.ui.adapter.PackageAdapter
//import com.dianzan.daka.R
//import kotlinx.android.synthetic.main.frg_home.*
//
//class PackageFragment : BasePageListFragment<PackagePresenter, PackageAdapter>(), PackageContract.View {
//
//    override fun initPresenter(): PackagePresenter? = PackagePresenter(this)
//
//    override fun layoutId(): Int = R.layout.frg_package
//
//    override fun initData() {
//        super.initData()
//        adapter?.setOnItemClickListener {
//                adapter, view, position ->
//
//
//        }
//    }
//
//    override fun initView() {
//    }
//
//    override fun start() {
//        presenter?.loadList(mCurrentPageNo)
//        presenter?.loadBanner()
//    }
//
//    override fun onRefresh() {
//        presenter?.loadList(mCurrentPageNo)
//    }
//
//    override fun onLoadMore() {
//        presenter?.loadList(mCurrentPageNo)
//    }
//
//    override fun initAdapter(): PackageAdapter? = PackageAdapter()
//    override fun loadListSuccess(data: BasePageResponse<PackageBean>) {
//        getDatasSuccess(data)
//    }
//
//    override fun loadListFail(fail: String) {
//        getDatasFail()
//    }
//    override fun loadBannerSuccess(data: List<BannerBean>) {
//        data.isEmpty().let {
//            banner.visibility = if (it) View.GONE else View.VISIBLE
//        }
//        banner.run {
//            setAutoPlayAble(data.size > 2)
//            setData(data, null)
//            setAdapter { banner, _, bannerInfo, position ->
//                var bannerBean = bannerInfo as BannerBean
//                ImageLoadHelp.loadImage(
//                    banner.getItemImageView(position), bannerBean.bannerUrl
//                )
//
//            }
//        }
//    }
//    override fun loadBannerFail() {
//        banner.visibility = View.GONE
//    }
//}